/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.crossriver.crgis.database.model.impl;

import com.crossriver.crgis.database.model.Contact_Information;
import com.crossriver.crgis.database.model.Contact_InformationModel;
import com.crossriver.crgis.database.model.Contact_InformationSoap;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

import java.sql.Types;

import java.util.ArrayList;
import java.util.List;

/**
 * The base model implementation for the Contact_Information service. Represents a row in the &quot;CRGIA_Contact_Information&quot; database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link com.crossriver.crgis.database.model.Contact_InformationModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link Contact_InformationImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. All methods that expect a contact_ information model instance should use the {@link com.crossriver.crgis.database.model.Contact_Information} interface instead.
 * </p>
 *
 * @author Wole Adetiba
 * @see Contact_InformationImpl
 * @see com.crossriver.crgis.database.model.Contact_Information
 * @see com.crossriver.crgis.database.model.Contact_InformationModel
 * @generated
 */
public class Contact_InformationModelImpl extends BaseModelImpl<Contact_Information>
	implements Contact_InformationModel {
	public static final String TABLE_NAME = "CRGIA_Contact_Information";
	public static final Object[][] TABLE_COLUMNS = {
			{ "applicationId", new Integer(Types.VARCHAR) },
			{ "userId", new Integer(Types.VARCHAR) },
			{ "houseNo", new Integer(Types.VARCHAR) },
			{ "addressLine1", new Integer(Types.VARCHAR) },
			{ "addressLine2", new Integer(Types.VARCHAR) },
			{ "city", new Integer(Types.VARCHAR) },
			{ "state", new Integer(Types.VARCHAR) },
			{ "country", new Integer(Types.VARCHAR) },
			{ "phoneHome", new Integer(Types.VARCHAR) },
			{ "phoneOffice", new Integer(Types.VARCHAR) },
			{ "phoneMobile", new Integer(Types.VARCHAR) },
			{ "fax", new Integer(Types.VARCHAR) },
			{ "poBox", new Integer(Types.VARCHAR) },
			{ "lga", new Integer(Types.VARCHAR) },
			{ "emailAddress", new Integer(Types.VARCHAR) },
			{ "otherInformation", new Integer(Types.VARCHAR) }
		};
	public static final String TABLE_SQL_CREATE = "create table CRGIA_Contact_Information (applicationId VARCHAR(75) not null primary key,userId VARCHAR(75) null,houseNo VARCHAR(75) null,addressLine1 VARCHAR(75) null,addressLine2 VARCHAR(75) null,city VARCHAR(75) null,state VARCHAR(75) null,country VARCHAR(75) null,phoneHome VARCHAR(75) null,phoneOffice VARCHAR(75) null,phoneMobile VARCHAR(75) null,fax VARCHAR(75) null,poBox VARCHAR(75) null,lga VARCHAR(75) null,emailAddress VARCHAR(75) null,otherInformation VARCHAR(75) null)";
	public static final String TABLE_SQL_DROP = "drop table CRGIA_Contact_Information";
	public static final String ORDER_BY_JPQL = " ORDER BY contact_Information.applicationId ASC";
	public static final String ORDER_BY_SQL = " ORDER BY CRGIA_Contact_Information.applicationId ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.com.crossriver.crgis.database.model.Contact_Information"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.com.crossriver.crgis.database.model.Contact_Information"),
			true);

	/**
	 * Converts the soap model instance into a normal model instance.
	 *
	 * @param soapModel the soap model instance to convert
	 * @return the normal model instance
	 */
	public static Contact_Information toModel(Contact_InformationSoap soapModel) {
		Contact_Information model = new Contact_InformationImpl();

		model.setApplicationId(soapModel.getApplicationId());
		model.setUserId(soapModel.getUserId());
		model.setHouseNo(soapModel.getHouseNo());
		model.setAddressLine1(soapModel.getAddressLine1());
		model.setAddressLine2(soapModel.getAddressLine2());
		model.setCity(soapModel.getCity());
		model.setState(soapModel.getState());
		model.setCountry(soapModel.getCountry());
		model.setPhoneHome(soapModel.getPhoneHome());
		model.setPhoneOffice(soapModel.getPhoneOffice());
		model.setPhoneMobile(soapModel.getPhoneMobile());
		model.setFax(soapModel.getFax());
		model.setPoBox(soapModel.getPoBox());
		model.setLga(soapModel.getLga());
		model.setEmailAddress(soapModel.getEmailAddress());
		model.setOtherInformation(soapModel.getOtherInformation());

		return model;
	}

	/**
	 * Converts the soap model instances into normal model instances.
	 *
	 * @param soapModels the soap model instances to convert
	 * @return the normal model instances
	 */
	public static List<Contact_Information> toModels(
		Contact_InformationSoap[] soapModels) {
		List<Contact_Information> models = new ArrayList<Contact_Information>(soapModels.length);

		for (Contact_InformationSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}

	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.com.crossriver.crgis.database.model.Contact_Information"));

	public Contact_InformationModelImpl() {
	}

	public String getPrimaryKey() {
		return _applicationId;
	}

	public void setPrimaryKey(String pk) {
		setApplicationId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return _applicationId;
	}

	public String getApplicationId() {
		if (_applicationId == null) {
			return StringPool.BLANK;
		}
		else {
			return _applicationId;
		}
	}

	public void setApplicationId(String applicationId) {
		_applicationId = applicationId;
	}

	public String getUserId() {
		if (_userId == null) {
			return StringPool.BLANK;
		}
		else {
			return _userId;
		}
	}

	public void setUserId(String userId) {
		_userId = userId;
	}

	public String getHouseNo() {
		if (_houseNo == null) {
			return StringPool.BLANK;
		}
		else {
			return _houseNo;
		}
	}

	public void setHouseNo(String houseNo) {
		_houseNo = houseNo;
	}

	public String getAddressLine1() {
		if (_addressLine1 == null) {
			return StringPool.BLANK;
		}
		else {
			return _addressLine1;
		}
	}

	public void setAddressLine1(String addressLine1) {
		_addressLine1 = addressLine1;
	}

	public String getAddressLine2() {
		if (_addressLine2 == null) {
			return StringPool.BLANK;
		}
		else {
			return _addressLine2;
		}
	}

	public void setAddressLine2(String addressLine2) {
		_addressLine2 = addressLine2;
	}

	public String getCity() {
		if (_city == null) {
			return StringPool.BLANK;
		}
		else {
			return _city;
		}
	}

	public void setCity(String city) {
		_city = city;
	}

	public String getState() {
		if (_state == null) {
			return StringPool.BLANK;
		}
		else {
			return _state;
		}
	}

	public void setState(String state) {
		_state = state;
	}

	public String getCountry() {
		if (_country == null) {
			return StringPool.BLANK;
		}
		else {
			return _country;
		}
	}

	public void setCountry(String country) {
		_country = country;
	}

	public String getPhoneHome() {
		if (_phoneHome == null) {
			return StringPool.BLANK;
		}
		else {
			return _phoneHome;
		}
	}

	public void setPhoneHome(String phoneHome) {
		_phoneHome = phoneHome;
	}

	public String getPhoneOffice() {
		if (_phoneOffice == null) {
			return StringPool.BLANK;
		}
		else {
			return _phoneOffice;
		}
	}

	public void setPhoneOffice(String phoneOffice) {
		_phoneOffice = phoneOffice;
	}

	public String getPhoneMobile() {
		if (_phoneMobile == null) {
			return StringPool.BLANK;
		}
		else {
			return _phoneMobile;
		}
	}

	public void setPhoneMobile(String phoneMobile) {
		_phoneMobile = phoneMobile;
	}

	public String getFax() {
		if (_fax == null) {
			return StringPool.BLANK;
		}
		else {
			return _fax;
		}
	}

	public void setFax(String fax) {
		_fax = fax;
	}

	public String getPoBox() {
		if (_poBox == null) {
			return StringPool.BLANK;
		}
		else {
			return _poBox;
		}
	}

	public void setPoBox(String poBox) {
		_poBox = poBox;
	}

	public String getLga() {
		if (_lga == null) {
			return StringPool.BLANK;
		}
		else {
			return _lga;
		}
	}

	public void setLga(String lga) {
		_lga = lga;
	}

	public String getEmailAddress() {
		if (_emailAddress == null) {
			return StringPool.BLANK;
		}
		else {
			return _emailAddress;
		}
	}

	public void setEmailAddress(String emailAddress) {
		_emailAddress = emailAddress;
	}

	public String getOtherInformation() {
		if (_otherInformation == null) {
			return StringPool.BLANK;
		}
		else {
			return _otherInformation;
		}
	}

	public void setOtherInformation(String otherInformation) {
		_otherInformation = otherInformation;
	}

	public Contact_Information toEscapedModel() {
		if (isEscapedModel()) {
			return (Contact_Information)this;
		}
		else {
			return (Contact_Information)Proxy.newProxyInstance(Contact_Information.class.getClassLoader(),
				new Class[] { Contact_Information.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		Contact_InformationImpl contact_InformationImpl = new Contact_InformationImpl();

		contact_InformationImpl.setApplicationId(getApplicationId());

		contact_InformationImpl.setUserId(getUserId());

		contact_InformationImpl.setHouseNo(getHouseNo());

		contact_InformationImpl.setAddressLine1(getAddressLine1());

		contact_InformationImpl.setAddressLine2(getAddressLine2());

		contact_InformationImpl.setCity(getCity());

		contact_InformationImpl.setState(getState());

		contact_InformationImpl.setCountry(getCountry());

		contact_InformationImpl.setPhoneHome(getPhoneHome());

		contact_InformationImpl.setPhoneOffice(getPhoneOffice());

		contact_InformationImpl.setPhoneMobile(getPhoneMobile());

		contact_InformationImpl.setFax(getFax());

		contact_InformationImpl.setPoBox(getPoBox());

		contact_InformationImpl.setLga(getLga());

		contact_InformationImpl.setEmailAddress(getEmailAddress());

		contact_InformationImpl.setOtherInformation(getOtherInformation());

		return contact_InformationImpl;
	}

	public int compareTo(Contact_Information contact_Information) {
		int value = 0;

		value = getApplicationId()
					.compareTo(contact_Information.getApplicationId());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		Contact_Information contact_Information = null;

		try {
			contact_Information = (Contact_Information)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		String pk = contact_Information.getPrimaryKey();

		if (getPrimaryKey().equals(pk)) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return getPrimaryKey().hashCode();
	}

	public String toString() {
		StringBundler sb = new StringBundler(33);

		sb.append("{applicationId=");
		sb.append(getApplicationId());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", houseNo=");
		sb.append(getHouseNo());
		sb.append(", addressLine1=");
		sb.append(getAddressLine1());
		sb.append(", addressLine2=");
		sb.append(getAddressLine2());
		sb.append(", city=");
		sb.append(getCity());
		sb.append(", state=");
		sb.append(getState());
		sb.append(", country=");
		sb.append(getCountry());
		sb.append(", phoneHome=");
		sb.append(getPhoneHome());
		sb.append(", phoneOffice=");
		sb.append(getPhoneOffice());
		sb.append(", phoneMobile=");
		sb.append(getPhoneMobile());
		sb.append(", fax=");
		sb.append(getFax());
		sb.append(", poBox=");
		sb.append(getPoBox());
		sb.append(", lga=");
		sb.append(getLga());
		sb.append(", emailAddress=");
		sb.append(getEmailAddress());
		sb.append(", otherInformation=");
		sb.append(getOtherInformation());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(52);

		sb.append("<model><model-name>");
		sb.append("com.crossriver.crgis.database.model.Contact_Information");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>applicationId</column-name><column-value><![CDATA[");
		sb.append(getApplicationId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>houseNo</column-name><column-value><![CDATA[");
		sb.append(getHouseNo());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>addressLine1</column-name><column-value><![CDATA[");
		sb.append(getAddressLine1());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>addressLine2</column-name><column-value><![CDATA[");
		sb.append(getAddressLine2());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>city</column-name><column-value><![CDATA[");
		sb.append(getCity());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>state</column-name><column-value><![CDATA[");
		sb.append(getState());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>country</column-name><column-value><![CDATA[");
		sb.append(getCountry());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>phoneHome</column-name><column-value><![CDATA[");
		sb.append(getPhoneHome());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>phoneOffice</column-name><column-value><![CDATA[");
		sb.append(getPhoneOffice());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>phoneMobile</column-name><column-value><![CDATA[");
		sb.append(getPhoneMobile());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>fax</column-name><column-value><![CDATA[");
		sb.append(getFax());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>poBox</column-name><column-value><![CDATA[");
		sb.append(getPoBox());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>lga</column-name><column-value><![CDATA[");
		sb.append(getLga());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>emailAddress</column-name><column-value><![CDATA[");
		sb.append(getEmailAddress());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>otherInformation</column-name><column-value><![CDATA[");
		sb.append(getOtherInformation());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private String _applicationId;
	private String _userId;
	private String _houseNo;
	private String _addressLine1;
	private String _addressLine2;
	private String _city;
	private String _state;
	private String _country;
	private String _phoneHome;
	private String _phoneOffice;
	private String _phoneMobile;
	private String _fax;
	private String _poBox;
	private String _lga;
	private String _emailAddress;
	private String _otherInformation;
}